<template>
	<view class="page">
		<free-nav-bar bgColor="bg-white" title="个人信息" showright>
			<free-icon-button slot="right">&#xe6ed;</free-icon-button>
		</free-nav-bar>

		<free-list-item
			:cover="user.avatar == ''? 'https://profile-avatar.csdnimg.cn/3365568353cd44c2acf217ab8b6345f9_weixin_47365777.jpg!1':user.avatar"
			:title="user.username" showright coverSize="120" @click="setting()">

			<view class="flex flex-column" slot="title1">
				<text class="font-md font-lg text-dark font-weight-bold">{{user.nickname||user.username}}</text>
				<text class="text-light-muted font-md mt-2">微信号:{{user.username}}</text>
			</view>
			<view class="iconfont font-md text-light-muted" slot="right">
				&#xe614;
			</view>
		</free-list-item>
		<free-divider></free-divider>
		<free-list-item title="支付" showright>
			<text class="iconfont font-lg py-2" slot="icon">&#xe66c;</text>

		</free-list-item>
		<free-divider></free-divider>
		<free-list-item title="收藏" showright @click="shoucang()">
			<text class="iconfont font-lg py-2" slot="icon">&#xea2d;</text>

		</free-list-item>
		<free-list-item title="相册" showright>
			<text class="iconfont font-lg py-2" slot="icon">&#xe608;</text>

		</free-list-item>
		<free-list-item title="表情" showright>
			<text class="iconfont font-lg py-2" slot="icon">&#xe605;</text>

		</free-list-item>
		<free-divider></free-divider>
		<free-list-item title="设置" showright @click="gosetting()">
			<text class="iconfont font-lg py-2" slot="icon">&#xe612;</text>

		</free-list-item>
	</view>
</template>

<script>
	import auth from "@/common/mixin/auth.js"
	import freeNavBar from "@/components/free-ui/free-nav-bar.vue"
	import freeListItem from "@/components/free-ui/free-list-item.vue"
	import freeIconButton from "@/components/free-ui/free-icon-button.vue"
	import freeDivider from "@/components/free-ui/free-divider.vue"
	import {
		mapState
	} from "vuex"
	export default {
		mixins: [auth],
		components: {
			freeNavBar,
			freeListItem,
			freeIconButton,
			freeDivider

		},
		computed: {
			...mapState({
				user: state => state.user.user
			})
		},
		data() {
			return {

			}
		},
		mounted() {
			console.log(this.user);
		},
		methods: {
			shoucang() {
				uni.navigateTo({
					url: "/pages/fava/fava"
				})
			},
			gosetting() {
				uni.navigateTo({
					url: "/pages/setting/setting"
				})
			},
			setting() {
				console.log(12333)
				uni.navigateTo({
					url: "/pages/userinfo/userinfo"
				})
			}
		}
	}
</script>

<style>

</style>
